package com.wc.算法基础课.B第二讲数据结构.树状数组.数星星;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/26 23:45
 * @description https://www.acwing.com/problem/content/1267/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 15010, M = 32010;
    static int[] tr = new int[M], level = new int[N];
    static int n, x, y;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            x = sc.nextInt() + 1;
            y = sc.nextInt();
            // 查询x的左边有多少个满足条件的,0~x，有多少个，他的等级就是多少
            int t = query(x);
            level[t]++;
            // 将它填进去
            add(x, 1);
        }
        for(int i = 0; i < n; i++){
            out.println(level[i]);
        }
        out.flush();
    }

    static int lowbit(int x) {
        return x & -x;
    }

    static int query(int x) {
        int res = 0;
        for (int i = x; i > 0; i -= lowbit(i)) {
            res += tr[i];
        }
        return res;
    }

    static void  add(int x, int v) {
        for (int i = x; i < M; i += lowbit(i)) {
            tr[i] += v;
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
